package com.app.ctzoverseas.network.http

import com.android.base_network.RetrofitClient
import com.cardetective.shopcar.network.api.LoginApi
import com.cardetective.shopcar.network.model.BindMobilePost
import com.cardetective.shopcar.network.model.LoginPost

class LoginNetwork {

    private val mLoginApi by lazy { RetrofitClient.getInstance().createApi(LoginApi::class.java) }

    fun postLogin(info : LoginPost) = mLoginApi.postLogin(info)
    fun bindMobile(info : BindMobilePost) = mLoginApi.bindMobile(info)

    companion object {
        @Volatile
        private var netWork: LoginNetwork? = null

        fun getInstance() = netWork ?: synchronized(this) {
            netWork ?: LoginNetwork().also { netWork = it }
        }
    }
}